using Senparc.Weixin.MP.AdvancedAPIs.Analysis;
using Senparc.Weixin.MP.CommonAPIs;
using System;
namespace Senparc.Weixin.MP.AdvancedAPIs
{
	public static class AnalysisApi
	{
		public static AnalysisResultJson<ArticleSummaryItem> GetArticleSummary(string accessTokenOrAppId, string beginDate, string endDate, int timeOut = 10000)
		{
			return ApiHandlerWapper.TryCommonApi<AnalysisResultJson<ArticleSummaryItem>>(delegate(string accessToken)
			{
				string urlFormat = "https://api.weixin.qq.com/datacube/getarticlesummary?access_token={0}";
				var data = new
				{
					begin_date = beginDate,
					end_date = endDate
				};
				return CommonJsonSend.Send<AnalysisResultJson<ArticleSummaryItem>>(accessToken, urlFormat, data, CommonJsonSendType.POST, timeOut, false);
			}, accessTokenOrAppId, true);
		}
		public static AnalysisResultJson<ArticleTotalItem> GetArticleTotal(string accessTokenOrAppId, string beginDate, string endDate, int timeOut = 10000)
		{
			return ApiHandlerWapper.TryCommonApi<AnalysisResultJson<ArticleTotalItem>>(delegate(string accessToken)
			{
				string urlFormat = "https://api.weixin.qq.com/datacube/getarticletotal?access_token={0}";
				var data = new
				{
					begin_date = beginDate,
					end_date = endDate
				};
				return CommonJsonSend.Send<AnalysisResultJson<ArticleTotalItem>>(accessToken, urlFormat, data, CommonJsonSendType.POST, timeOut, false);
			}, accessTokenOrAppId, true);
		}
		public static AnalysisResultJson<UserReadItem> GetUserRead(string accessTokenOrAppId, string beginDate, string endDate, int timeOut = 10000)
		{
			return ApiHandlerWapper.TryCommonApi<AnalysisResultJson<UserReadItem>>(delegate(string accessToken)
			{
				string urlFormat = "https://api.weixin.qq.com/datacube/getuserread?access_token={0}";
				var data = new
				{
					begin_date = beginDate,
					end_date = endDate
				};
				return CommonJsonSend.Send<AnalysisResultJson<UserReadItem>>(accessToken, urlFormat, data, CommonJsonSendType.POST, timeOut, false);
			}, accessTokenOrAppId, true);
		}
		public static AnalysisResultJson<UserReadHourItem> GetUserReadHour(string accessTokenOrAppId, string beginDate, string endDate, int timeOut = 10000)
		{
			return ApiHandlerWapper.TryCommonApi<AnalysisResultJson<UserReadHourItem>>(delegate(string accessToken)
			{
				string urlFormat = "https://api.weixin.qq.com/datacube/getuserreadhour?access_token={0}";
				var data = new
				{
					begin_date = beginDate,
					end_date = endDate
				};
				return CommonJsonSend.Send<AnalysisResultJson<UserReadHourItem>>(accessToken, urlFormat, data, CommonJsonSendType.POST, timeOut, false);
			}, accessTokenOrAppId, true);
		}
		public static AnalysisResultJson<UserShareItem> GetUserShare(string accessTokenOrAppId, string beginDate, string endDate, int timeOut = 10000)
		{
			return ApiHandlerWapper.TryCommonApi<AnalysisResultJson<UserShareItem>>(delegate(string accessToken)
			{
				string urlFormat = "https://api.weixin.qq.com/datacube/getusershare?access_token={0}";
				var data = new
				{
					begin_date = beginDate,
					end_date = endDate
				};
				return CommonJsonSend.Send<AnalysisResultJson<UserShareItem>>(accessToken, urlFormat, data, CommonJsonSendType.POST, timeOut, false);
			}, accessTokenOrAppId, true);
		}
		public static AnalysisResultJson<UserShareHourItem> GetUserShareHour(string accessTokenOrAppId, string beginDate, string endDate, int timeOut = 10000)
		{
			return ApiHandlerWapper.TryCommonApi<AnalysisResultJson<UserShareHourItem>>(delegate(string accessToken)
			{
				string urlFormat = "https://api.weixin.qq.com/datacube/getusersharehour?access_token={0}";
				var data = new
				{
					begin_date = beginDate,
					end_date = endDate
				};
				return CommonJsonSend.Send<AnalysisResultJson<UserShareHourItem>>(accessToken, urlFormat, data, CommonJsonSendType.POST, timeOut, false);
			}, accessTokenOrAppId, true);
		}
		public static AnalysisResultJson<InterfaceSummaryItem> GetInterfaceSummary(string accessTokenOrAppId, string beginDate, string endDate, int timeOut = 10000)
		{
			return ApiHandlerWapper.TryCommonApi<AnalysisResultJson<InterfaceSummaryItem>>(delegate(string accessToken)
			{
				string urlFormat = "https://api.weixin.qq.com/datacube/getinterfacesummary?access_token={0}";
				var data = new
				{
					begin_date = beginDate,
					end_date = endDate
				};
				return CommonJsonSend.Send<AnalysisResultJson<InterfaceSummaryItem>>(accessToken, urlFormat, data, CommonJsonSendType.POST, timeOut, false);
			}, accessTokenOrAppId, true);
		}
		public static AnalysisResultJson<InterfaceSummaryHourItem> GetInterfaceSummaryHour(string accessTokenOrAppId, string beginDate, string endDate, int timeOut = 10000)
		{
			return ApiHandlerWapper.TryCommonApi<AnalysisResultJson<InterfaceSummaryHourItem>>(delegate(string accessToken)
			{
				string urlFormat = "https://api.weixin.qq.com/datacube/getinterfacesummaryhour?access_token={0}";
				var data = new
				{
					begin_date = beginDate,
					end_date = endDate
				};
				return CommonJsonSend.Send<AnalysisResultJson<InterfaceSummaryHourItem>>(accessToken, urlFormat, data, CommonJsonSendType.POST, timeOut, false);
			}, accessTokenOrAppId, true);
		}
		public static AnalysisResultJson<UpStreamMsgItem> GetUpStreamMsg(string accessTokenOrAppId, string beginDate, string endDate, int timeOut = 10000)
		{
			return ApiHandlerWapper.TryCommonApi<AnalysisResultJson<UpStreamMsgItem>>(delegate(string accessToken)
			{
				string urlFormat = "https://api.weixin.qq.com/datacube/getupstreammsg?access_token={0}";
				var data = new
				{
					begin_date = beginDate,
					end_date = endDate
				};
				return CommonJsonSend.Send<AnalysisResultJson<UpStreamMsgItem>>(accessToken, urlFormat, data, CommonJsonSendType.POST, timeOut, false);
			}, accessTokenOrAppId, true);
		}
		public static AnalysisResultJson<UpStreamMsgHourItem> GetUpStreamMsgHour(string accessTokenOrAppId, string beginDate, string endDate, int timeOut = 10000)
		{
			return ApiHandlerWapper.TryCommonApi<AnalysisResultJson<UpStreamMsgHourItem>>(delegate(string accessToken)
			{
				string urlFormat = "https://api.weixin.qq.com/datacube/getupstreammsghour?access_token={0}";
				var data = new
				{
					begin_date = beginDate,
					end_date = endDate
				};
				return CommonJsonSend.Send<AnalysisResultJson<UpStreamMsgHourItem>>(accessToken, urlFormat, data, CommonJsonSendType.POST, timeOut, false);
			}, accessTokenOrAppId, true);
		}
		public static AnalysisResultJson<UpStreamMsgWeekItem> GetUpStreamMsgWeek(string accessTokenOrAppId, string beginDate, string endDate, int timeOut = 10000)
		{
			return ApiHandlerWapper.TryCommonApi<AnalysisResultJson<UpStreamMsgWeekItem>>(delegate(string accessToken)
			{
				string urlFormat = "https://api.weixin.qq.com/datacube/getupstreammsgweek?access_token={0}";
				var data = new
				{
					begin_date = beginDate,
					end_date = endDate
				};
				return CommonJsonSend.Send<AnalysisResultJson<UpStreamMsgWeekItem>>(accessToken, urlFormat, data, CommonJsonSendType.POST, timeOut, false);
			}, accessTokenOrAppId, true);
		}
		public static AnalysisResultJson<UpStreamMsgMonthItem> GetUpStreamMsgMonth(string accessTokenOrAppId, string beginDate, string endDate, int timeOut = 10000)
		{
			return ApiHandlerWapper.TryCommonApi<AnalysisResultJson<UpStreamMsgMonthItem>>(delegate(string accessToken)
			{
				string urlFormat = "https://api.weixin.qq.com/datacube/getupstreammsgmonth?access_token={0}";
				var data = new
				{
					begin_date = beginDate,
					end_date = endDate
				};
				return CommonJsonSend.Send<AnalysisResultJson<UpStreamMsgMonthItem>>(accessToken, urlFormat, data, CommonJsonSendType.POST, timeOut, false);
			}, accessTokenOrAppId, true);
		}
		public static AnalysisResultJson<UpStreamMsgDistItem> GetUpStreamMsgDist(string accessTokenOrAppId, string beginDate, string endDate, int timeOut = 10000)
		{
			return ApiHandlerWapper.TryCommonApi<AnalysisResultJson<UpStreamMsgDistItem>>(delegate(string accessToken)
			{
				string urlFormat = "https://api.weixin.qq.com/datacube/getupstreammsgdist?access_token={0}";
				var data = new
				{
					begin_date = beginDate,
					end_date = endDate
				};
				return CommonJsonSend.Send<AnalysisResultJson<UpStreamMsgDistItem>>(accessToken, urlFormat, data, CommonJsonSendType.POST, timeOut, false);
			}, accessTokenOrAppId, true);
		}
		public static AnalysisResultJson<UpStreamMsgDistWeekItem> GetUpStreamMsgDistWeek(string accessTokenOrAppId, string beginDate, string endDate, int timeOut = 10000)
		{
			return ApiHandlerWapper.TryCommonApi<AnalysisResultJson<UpStreamMsgDistWeekItem>>(delegate(string accessToken)
			{
				string urlFormat = "https://api.weixin.qq.com/datacube/getupstreammsgdistweek?access_token={0}";
				var data = new
				{
					begin_date = beginDate,
					end_date = endDate
				};
				return CommonJsonSend.Send<AnalysisResultJson<UpStreamMsgDistWeekItem>>(accessToken, urlFormat, data, CommonJsonSendType.POST, timeOut, false);
			}, accessTokenOrAppId, true);
		}
		public static AnalysisResultJson<UpStreamMsgDistMonthItem> GetUpStreamMsgDistMonth(string accessTokenOrAppId, string beginDate, string endDate, int timeOut = 10000)
		{
			return ApiHandlerWapper.TryCommonApi<AnalysisResultJson<UpStreamMsgDistMonthItem>>(delegate(string accessToken)
			{
				string urlFormat = "https://api.weixin.qq.com/datacube/getupstreammsgdistmonth?access_token={0}";
				var data = new
				{
					begin_date = beginDate,
					end_date = endDate
				};
				return CommonJsonSend.Send<AnalysisResultJson<UpStreamMsgDistMonthItem>>(accessToken, urlFormat, data, CommonJsonSendType.POST, timeOut, false);
			}, accessTokenOrAppId, true);
		}
		public static AnalysisResultJson<UserSummaryItem> GetUserSummary(string accessTokenOrAppId, string beginDate, string endDate, int timeOut = 10000)
		{
			return ApiHandlerWapper.TryCommonApi<AnalysisResultJson<UserSummaryItem>>(delegate(string accessToken)
			{
				string urlFormat = "https://api.weixin.qq.com/datacube/getusersummary?access_token={0}";
				var data = new
				{
					begin_date = beginDate,
					end_date = endDate
				};
				return CommonJsonSend.Send<AnalysisResultJson<UserSummaryItem>>(accessToken, urlFormat, data, CommonJsonSendType.POST, timeOut, false);
			}, accessTokenOrAppId, true);
		}
		public static AnalysisResultJson<UserCumulateItem> GetUserCumulate(string accessTokenOrAppId, string beginDate, string endDate, int timeOut = 10000)
		{
			return ApiHandlerWapper.TryCommonApi<AnalysisResultJson<UserCumulateItem>>(delegate(string accessToken)
			{
				string urlFormat = "https://api.weixin.qq.com/datacube/getusercumulate?access_token={0}";
				var data = new
				{
					begin_date = beginDate,
					end_date = endDate
				};
				return CommonJsonSend.Send<AnalysisResultJson<UserCumulateItem>>(accessToken, urlFormat, data, CommonJsonSendType.POST, timeOut, false);
			}, accessTokenOrAppId, true);
		}
	}
}
